void main() {
  // for
  print('************ for循环 ********************');
  for (int i = 0; i < 3; i++) {
    print(i);
  }

  List arr = ['张三', '李四', '王五'];
  for (int i = 0; i < arr.length; i++) {
    print(arr[i]);
  }

  // while
  print('************ while循环 ********************');
  int i = 0;
  while (i < 3) {
    i++;
    print(i);
  }
  // do while
  print('************ do while循环 ********************');
  int j = 0;
  do {
    j++;
    print(j);
  } while (j < 3);

  // break
  print('************ break ********************');
  for (int i = 0; i < 3; i++) {
    if (i == 1) break; // 结束循环，只能结束一层循环
    print(i);
  }

  // continue
  print('************ continue ********************');
  for (int i = 0; i < 3; i++) {
    if (i == 1) continue; // 跳过当前循环，继续下一次循环
    print(i);
  }

  // for in
  print('************ for in 接受一个参数********************');
  arr = ['张三', '李四', '王五'];
  for (var item in arr) {
    print(item);
  }
}
